Skip to content

feat: use shared informers to reduce memory and goroutines#10

Merged
zachsmith1 merged 1 commit intomainfrom
feat/sharedinformers
Feb 16, 2026
Merged

feat: use shared informers to reduce memory and goroutines#10
zachsmith1 merged 1 commit intomainfrom
feat/sharedinformers

Conversation

@zachsmith1
Copy link
Contributor

At 200 VCP scale, the dominant cost was informer/listener fanout (O(clusters * resources)) and duplicated controller wiring. Namespace and admission webhook paths were still paying per-cluster overhead, and CRD routing/controller setup had become harder to reason about.

This PR reduces that fanout by moving to shared informer surfaces with cluster-scoped projection, while preserving strict per-cluster isolation semantics.

How It Works

  1. Shared Informer + Cluster-Scoped Views (Namespace and Webhook)
    Namespace and webhook managers now rely on shared informer factories and scoped listers/informers instead of spinning per-cluster factories for hot resources.
    scopedFactory implementations project a per-cluster view from shared indexes using cluster-label filtering.
    Result: one shared watch pipeline for key resources, cluster isolation enforced at projection/lister boundaries.

  2. List-Backed Webhook Configuration Sources
    Mutating/validating webhook config sources now read via listers and cache accessors by name+resourceVersion.
    They intentionally avoid per-plugin informer handler registration, collapsing listener fanout.
    Result: lower goroutine count and less memory pressure in webhook-heavy paths without changing webhook behavior.

  3. CRD Multicluster Routing/Controller Cleanup
    CRD routing is refactored to use unified multicluster handling (serveClusterCRD) and clearer controller wiring.
    Shared CRD projection/runtime logic is used for cluster-aware lookup and status flow, reducing duplicated control paths.
    Result: simpler routing semantics, fewer replicated loops, and better correctness under multicluster churn.
    Impact and Verification

Improves scalability by replacing per-cluster informer/controller duplication with shared pipelines plus cluster-scoped projection.

Preserves isolation: CRUD/list/watch behavior remains per-cluster from caller perspective.
Validated with smoke coverage across RBAC, namespace lifecycle, webhook scoping, CRD establish/discovery/update, and 200 VCP memory runs.

Net effect: materially lower goroutine overhead and improved memory profile consistency at high VCP counts.

@zachsmith1 zachsmith1 merged commit 08080dc into main Feb 16, 2026
1 check failed
@zachsmith1 zachsmith1 deleted the feat/sharedinformers branch February 16, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant